export const report = {
  data () {
    return {
    }
  },
  methods: {
    bookNull (e) {
      return require('@/assets/images/book-kong.png')
    },
    // 判断图片是否存在
    validateImage (pathImg) {
      var ImgObj = new Image()
      ImgObj.src = pathImg
      if (ImgObj.fileSize > 0 || (ImgObj.width > 0 && ImgObj.height > 0)) {
        if (pathImg.indexOf('book-default-lpic.gif') !== -1) {
          return false
        } else {
          return true
        }
      } else {
        return false
      }
    },
    // 图片处理替换
    bookImgFilter (e) {
      if (e.indexOf('book-default-lpic.gif') !== -1) {
        return require('@/assets/images/book-kong.png')
      } else {
        return e
      }
    },
    moveErrorImg (event) {
      event.currentTarget.src = this.bookNull()
      return true
    }
  }
}
